<template>
<!-- @click="cliclItem(AtallObj.id,AtallObj.classid)">:需要些按顺序写才行。在 newestitem里面是
另一种方式，把他弄城一个对象，就可以不用按顺序来写
-->
  <div class="artitem" @click="cliclItem(AtallObj.id,AtallObj.classid)">
    <div class="pic">
      <img :src="AtallObj.picurl" alt="">
    </div>
    <div class="text">
      <div class="title">{{AtallObj.title}}</div>
      <div class="info">
        <div class="time">
          <i class="iconfont icon-clock"></i>
          {{myDate(AtallObj.posttime,1)}}</div>
        <div class="hits">
          <i class="iconfont icon-browse"></i>
          {{getNum(AtallObj.hits)}}</div>
      </div>
    </div>
  </div>
</template>

<script>
import common from '@/assets/js/common.js'
// console.log(common.getNum(9999));
export default {
  props: {
    AtallObj: {
      type: Object,
      default () {
        return {

        }
      }
    }
  },
  methods: {
    cliclItem (id, cid) {
      this.$router.push('/detail?id=' + id + '&type=list&cid=' + cid)
      // {path: "",query:{}}
    },
    getNum (str) {
      return common.getNum(str)
    },
    myDate (time, val) {
      return common.myDate(time, val)
    }
  }
}
</script>

<style lang="less" scoped>
.artitem{
  border: .01rem solid #e8e8e8;
  display: flex;
  height: 1.6rem;
  margin-bottom: 0.3rem;
  .pic{
    width: 35%;
    img{
      width: 100%;
      height: 100%;
    }
  }
  .text{
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: 65%;
    padding:.08rem .2rem;
    font-size: 0.26rem;
    .title{
      font-size: .28rem;
      font-weight: 600;
      color:#333;
    }
    .info{
      display: flex;
      justify-content:space-between;
      color:#888;
    }
  }
}
</style>
